var arr = ['*', 'd', 'c', '*', 'e', '*', 'a', '*'];

function parse(arr) {
    var str = arr.join(''),
        counter = 0;
    str = str.replace(/\*/g, function() {
        counter++;
        return '';
    })
    console.log('replace.old:%s,counter:', str, counter);
    while (counter > 0) {
        str = '*' + str;
        counter--;
    }
    console.log('replace.new:%s,counter:', str, counter);
    return str.split('');
}

console.log(parse(arr));
// 期望结果
// [ '*', '*', '*', '*', 'd', 'c', 'e', 'a' ]
